package yjj.system.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yjj.system.entity.Role;
import yjj.system.service.RoleService;

@RestController
@RequestMapping("/roles")
@Tag(name = "角色管理")
public class RoleController {
    @Autowired
    RoleService roleService;

    @PostMapping("add")
    @Operation(summary = "添加角色")
    public void addRole(@RequestBody Role role){
        roleService.save(role);
    }
}
